﻿/*
Author: Christoph van der Fecht
CodePlex: http://www.codeplex.com/site/users/view/ChristophvdF

Copyright(c) Christoph van der Fecht
*/
using System.Windows;
using SerienNewsReader.ViewModel;
using System.Diagnostics;
using System.Windows.Documents;

namespace SerienNewsReader
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            Closing += (s, e) => ViewModelLocator.Cleanup();
        }

        /// <summary>
        /// Opens the Hyperlink with the default browser
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnHyperlink_Click(object sender, RoutedEventArgs e)
        {
            Process.Start((e.Source as Hyperlink).NavigateUri.ToString());
        }
    }
}
